import { Component } from 'react'
// import {useNavigate} from 'react-router-dom'
// function Onec(){
//     let o = useNavigate()

//     return (
//         <div className='box'>
//             <span onClick={()=>{
//                 o(-1)
//             }}>OOO</span>
//         </div>
//     )
// }
// export default Onec



import { useParams, useLocation, useNavigate } from "react-router-dom"

import { getBannerPort } from '../http/api'

function withRouter(Component) {
  return (props) => (
    <Component
      {...props}
      params={useParams()}
      location={useLocation()}
      navigate={useNavigate()}
    />
  );
}

class Onec extends Component {
  constructor() {
    super()
    this.state = {}
  }
  async componentDidMount() {
    let res = await getBannerPort()
    console.log(res);
  }
  render() {
    return (
      <div className='box'>
        <span onClick={() => {
          this.props.navigate(-1)
        }}>Oencv</span>
      </div>
    )
  }
}
export default withRouter(Onec)
